package com.example.pattern.singleton;

/**
 * 双重检查锁定（线程安全）
 *
 * @author FM_南风
 * @date 2024/6/22
 */
public class SingletonD {
 private SingletonD() {}

 private static class SingletonHolder {
  private static final SingletonD INSTANCE = new SingletonD();
 }

 public static SingletonD getInstance() {
  return SingletonHolder.INSTANCE;
 }
}